import Vue from 'vue'
import Router from 'vue-router'
// import Home from '../views/Home'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: 'html',
  routes: [
    {
      path: '/',
      name: 'home',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Customs'], () => {
          resolve(require('../views/Customs'))
        })
      }
    },
    {
      path: '/customs',
      name: 'normal-customs',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Customs'], () => {
          resolve(require('../views/Customs'))
        })
      }
    },
    {
      path: '/social-customs',
      name: 'social-customs',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Customs'], () => {
          resolve(require('../views/Customs'))
        })
      }
    },
    {
      path: '/export-customs',
      name: 'export-customs',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Customs'], () => {
          resolve(require('../views/Customs'))
        })
      }
    },
    {
      path: '/channels',
      name: 'channels',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Channels'], () => {
          resolve(require('../views/Channels'))
        })
      }
    },
    {
      path: '/undefined_channels',
      name: 'undefined_channels',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views//UndefinedChannels'], () => {
          resolve(require('../views/UndefinedChannels'))
        })
      }
    },
    {
      path: '/user/login',
      name: 'login',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Login'], () => {
          resolve(require('../views/Login'))
        })
      }
    },

    {
      path: '/user/register',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Register'], () => {
          resolve(require('../views/Register'))
        })
      }
    },

    {
      path: '/user/fogot',
      component: resolve => {
        // require.ensure 是 Webpack 的特殊语法，用来设置 code-split point
        // （代码分块）
        require.ensure(['../views/Forgot'], () => {
          resolve(require('../views/Forgot'))
        })
      }
    },

    {
      path: '/import-users',
      name: 'import-users',
      component: resolve => {
        require.ensure(['../views/ImportUsers'], () => {
          resolve(require('../views/ImportUsers'))
        })
      }
    },

    {
      path: '/profile',
      name: 'profile',
      component: resolve => {
        require.ensure(['../views/Profile'], () => {
          resolve(require('../views/Profile'))
        })
      }
    },

    {
      path: '/customs',
      name: 'customs',
      component: resolve => {
        require.ensure(['../views/Customs'], () => {
          resolve(require('../views/Customs'))
        })
      }
    },
    {
      path: '/sms',
      name: 'sms',
      component: resolve => {
        require.ensure(['../views/Sms'], () => {
          resolve(require('../views/Sms'))
        })
      }
    },

    {
      path: '/source',
      name: 'source',
      component: resolve => {
        require.ensure(['../views/Source'], () => {
          resolve(require('../views/Source'))
        })
      }
    },
    {
      path: '/source/edit/:id',
      name: 'editSource',
      component: resolve => {
        require.ensure(['../views/Source'], () => {
          resolve(require('../views/Source'))
        })
      }
    },

    {
      path: '/customs/:id',
      name: 'customsDt',
      component: resolve => {
        require.ensure(['../views/Customs'], () => {
          resolve(require('../views/Customs'))
        })
      }
    },

    {
      path: '/customs/:id/edit',
      name: 'editCustom',
      component: resolve => {
        require.ensure(['../views/Customs'], () => {
          resolve(require('../views/Customs'))
        })
      }
    },

    {
      path: '/channels/:id',
      name: 'channelDt',
      component: resolve => {
        require.ensure(['../views/EditChannel'], () => {
          resolve(require('../views/EditChannel'))
        })
      }
    },
    {
      path: '/analysis',
      name: 'analysis',
      component: resolve => {
        require.ensure(['../views/TradeAnalysis'], () => {
          resolve(require('../views/TradeAnalysis'))
        })
      }
    }
  ]
})
